package com.quanyan.ic.constants;

import com.quanyan.ic.common.model.OrderMessage;

/**
 * Created by zhuo.shi on 2017/6/2.
 */
public class RedisKey {

    private static String PREFIX = "lightic:";

    public static String buildOrderMsgUniqueKey(OrderMessage orderMessage) {
        return PREFIX + "orderMsg:consumed:" + orderMessage.getPlaceId() + ":" + orderMessage.getSiteId() + ":"
                + orderMessage.getStartTime() + "_" + orderMessage.getEndTime() + "_" + orderMessage.getOrderStatus();
    }

    public static String buildOrderMsgUniqueKeyPattern(int placeId) {
        return PREFIX + "orderMsg:consumed:" + placeId + "*";
    }

    public static String buildSendFailedOrderMsgKey(int placeId) {
        return PREFIX + "orderMsg:failed:" + placeId;
    }

    public static String buildCmdUniKey() {
        return PREFIX + "cmdResp";
    }
}
